package com.fare.taluo.application.impl.crawl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fare.taluo.application.crawl.TaskAssignDayApplication;
import com.fare.taluo.core.domain.crawl.TaskAssignDayEntity;
import com.fare.taluo.vo.core.TaskAssignDayEntityVO;
@Transactional
@Scope("singleton")
@Service("taskAssignDayApplication")
public class TaskAssignDayApplicationImpl implements TaskAssignDayApplication{

	@Override
	public List<TaskAssignDayEntityVO> findVoByTempId(Long tempId) {
		TaskAssignDayEntity entity=new TaskAssignDayEntity();
		List<TaskAssignDayEntityVO> voList=new ArrayList<TaskAssignDayEntityVO>();
		try {
			List<TaskAssignDayEntity> list=entity.findTaskAssignDayEntityByTempId(tempId);
			if(list.size()>0){
				for(TaskAssignDayEntity entitys : list ){
					TaskAssignDayEntityVO vos=new TaskAssignDayEntityVO();
					vos.setAssignFlightDay(entitys.getAssignFlightDay());
					vos.setAssignRoundDay(entitys.getAssignFlightDay());
					vos.setId(entitys.getId());
					vos.setTemplateId(entitys.getTaskTemplateEntity().getId());
					voList.add(vos);
				}
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return voList;
	}

}
